package com.slz3.business.module.memberManagement.memRaffleTicket.steward;

import com.slz3.business.frame.response.RR;
import com.slz3.business.frame.response.ResInfo;
import com.slz3.business.module.memberManagement.memRaffleTicket.domain.MemRaffleTicket;
import com.slz3.business.module.memberManagement.memRaffleTicket.domain.MemRaffleTicketCondition;
import org.springframework.stereotype.Controller;
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.reactive.function.server.ServerResponse;
import reactor.core.publisher.Mono;

import javax.annotation.Resource;

public class MemRaffleTicketResController extends MemRaffleTicketResAtomic {

    public Mono<ServerResponse> add(ServerRequest req, MemRaffleTicket memRaffleTicket) {
        if (MemRaffleTicketResUnsafeValid.add(req, memRaffleTicket)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.add_$MemRaffleTicketUpdateLock(req, memRaffleTicket);
        }
    }

    public Mono<ServerResponse> delete(ServerRequest req, MemRaffleTicketCondition memRaffleTicketCondition) {
        if (MemRaffleTicketResUnsafeValid.delete(req, memRaffleTicketCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.delete_$MemRaffleTicketUpdateLock(req, memRaffleTicketCondition);
        }
    }

    public Mono<ServerResponse> modify(ServerRequest req, MemRaffleTicket memRaffleTicket) {
        if (MemRaffleTicketResUnsafeValid.modify(req, memRaffleTicket)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.modify_$MemRaffleTicketUpdateLock(req, memRaffleTicket);
        }
    }

    public Mono<ServerResponse> list(ServerRequest req) {
        if (MemRaffleTicketResUnsafeValid.list(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.list(req);
        }
    }

    public Mono<ServerResponse> info(ServerRequest req) {
//        return memRaffleTicketResAtomic.info_$MemRaffleTicketUpdateLock(req);
        if (MemRaffleTicketResUnsafeValid.info(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.info_$MemRaffleTicketUpdateLock(req);
        }
    }

    public Mono<ServerResponse> choice(ServerRequest req) {
        if (MemRaffleTicketResUnsafeValid.choice(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.choice(req);
        }
    }

    public Mono<ServerResponse> auditSubmit(ServerRequest req, MemRaffleTicketCondition memRaffleTicketCondition) {
        //
        if (MemRaffleTicketResUnsafeValid.auditSubmit(req, memRaffleTicketCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.auditSubmit_$MemRaffleTicketUpdateLock(req, memRaffleTicketCondition);
        }
    }

    public Mono<ServerResponse> audit(ServerRequest req, MemRaffleTicketCondition memRaffleTicketCondition) {
        if (MemRaffleTicketResUnsafeValid.audit(req, memRaffleTicketCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.audit_$MemRaffleTicketUpdateLock(req, memRaffleTicketCondition);
        }
    }

    public Mono<ServerResponse> auditReject(ServerRequest req, MemRaffleTicketCondition memRaffleTicketCondition) {
        if (MemRaffleTicketResUnsafeValid.auditReject(req, memRaffleTicketCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.auditReject_$MemRaffleTicketUpdateLock(req, memRaffleTicketCondition);
        }
    }

    public Mono<ServerResponse> usingEnable(ServerRequest req, MemRaffleTicketCondition memRaffleTicketCondition) {
        if (MemRaffleTicketResUnsafeValid.usingEnable(req, memRaffleTicketCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.usingEnable_$MemRaffleTicketUpdateLock(req, memRaffleTicketCondition);
        }
    }

    public Mono<ServerResponse> usingDisable(ServerRequest req, MemRaffleTicketCondition memRaffleTicketCondition) {
        if (MemRaffleTicketResUnsafeValid.usingDisable(req, memRaffleTicketCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.usingDisable_$MemRaffleTicketUpdateLock(req, memRaffleTicketCondition);
        }
    }

}
